{include file="public/header" /}
<link rel="stylesheet" href="/static/index/css/page/address.css">
<body>
<div class="build-navbar" data-title="地址管理"></div>
<div class="main">
    {if count($list) > 0}
    {foreach name="list" item="vo"}
    <div class="address-item p-30 m-30">
        <div class="top flex items-center">
            <span class="name">{$vo.nickname}</span>
            <span class="tel">{$vo.tel}</span>
            {if $vo.default == 1}<span class="default">默认</span>{/if}
        </div>
        <div class="line-2 details mb-30">{$vo.p.title}{$vo.c.title}{$vo.d.title}{$vo.details}</div>
        <div class="btn-container flex items-center justify-between ">
            <div class="default flex items-center justify-start" data-url="{:url('address/defaultAddress')}" data-id="{$vo.id}" lay-event="submit">
                <img src="/static/index/images/{$vo.default == 1 ?'':'not-'}check.png" alt="" class="icon">
                <span class="text">{$vo.default == 1?'已默认':'设为默认'}</span>
            </div>
            <div class="operate flex items-center justify-end">
                <div class="delete flex items-center justify-center"
                     data-url="{:url('address/delete')}"
                     data-id="{$vo.id}"
                     data-pclass="address-item"
                     lay-event="delete">
                    <i class="layui-icon layui-icon-delete"></i>
                    <span>删除</span>
                </div>
                <div class="edit flex items-center justify-center" lay-event="jump"
                     lay-url="{:url('address/add')}?id={$vo.id}">
                    <i class="layui-icon layui-icon-edit"></i>
                    <span>编辑</span>
                </div>
            </div>
        </div>
    </div>
    {/foreach}
    {else}
    <div class="build-no-more" data-title="暂无地址"></div>
    {/if}

    <div class="btn theme-btn add" lay-event="jump" lay-url="{:url('address/add')}">添加收货地址</div>
</div>

</body>
{include file="public/footer"/}
</html>